package version2024.easy;

import java.util.Scanner;

/**
 * @author sunhl
 * @Description:
 * @Date: created in 2025/1/14 星期二 17:20
 * @Modified By:
 */
public class HJ40_StatisticalCharacter {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            String str = in.nextLine();
            String s1 = str.replaceAll("[A-Za-z]+", "");
            int a = str.length() - s1.length();

            String s2 = str.replaceAll(" ", "");
            int b = str.length() - s2.length();

            String s3 = str.replaceAll("[0-9]+", "");
            int c = str.length() - s3.length();

            String s4 = str.replaceAll("[A-Za-z0-9\\ ]+", "");
            int d = s4.length();

            System.out.println(a);
            System.out.println(b);
            System.out.println(c);
            System.out.println(d);
        }
    }
}
